package com.example.animation_01;

import android.content.Intent;
import android.os.Bundle;
import android.transition.Explode;
import android.transition.Fade;
import android.transition.Slide;


import androidx.annotation.Nullable;
import androidx.appcompat.app.AppCompatActivity;

public class TranslationToActivity extends AppCompatActivity {

    @Override
    protected void onCreate(@Nullable Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_to);
        Intent intent=getIntent();
        int flag=intent.getIntExtra("flag",1);
        if (flag==1){
            getWindow().setEnterTransition(new Explode().setDuration(1200));
        } else if (flag==2) {
            getWindow().setEnterTransition(new Slide());
        } else if (flag==3) {
            getWindow().setEnterTransition(new Fade());}
//        }else {
//            getWindow().setEnterTransition(new Shape() {
//                @Override
//                public void draw(Canvas canvas, Paint paint) {
//
//                }
//            });
//        }

    }

}
